Skip to content

fix(obs-studio): reject NaN in validate_range - #396

Merged
yuh-yang merged 1 commit into
HKUDS:mainfrom
santhreal:fix/obs-validate-range-nan-v2
Aug 3, 2026
Merged

fix(obs-studio): reject NaN in validate_range#396
yuh-yang merged 1 commit into
HKUDS:mainfrom
santhreal:fix/obs-validate-range-nan-v2

Conversation

@santhreal

Copy link
Copy Markdown
Contributor

validate_range is used for opacity, volume, and similar bounded floats. NaN made both min and max comparisons false, so the value was accepted and could be written into project JSON.

Non-finite values are now rejected before the range check.

Repro: validate_range(float("nan"), 0.0, 1.0, "Opacity") returned nan on main and now raises ValueError.

NaN bypassed min/max checks because NaN comparisons are always false,
so invalid opacity/volume values could be stored. Reject non-finite
floats before the range compare.
@github-actions github-actions Bot added the existing-cli-fix Fixes or improves an existing CLI harness label Jul 19, 2026
@yuh-yang
yuh-yang merged commit c987d09 into HKUDS:main Aug 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

existing-cli-fix Fixes or improves an existing CLI harness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants